<template>
  <div>
    <h1>Child</h1>
    <p>接收的值是{{ count }}</p>
    <button @click="updateProp">修改prop接收的count</button>
    <button @click="changeCount(2)">向父组件传值修改count</button>
  </div>
</template>

<script>
export default {
  name: "Child",
  props: ["count", "changeCount"],
  /* props: {
    count: Number,
    changeCount: Function,
  }, */
  /* props: {
    count: {
      type: Number,
      require: true,
    },
    changeCount: Function,
  }, */
  methods: {
    updateProp() {
      this.count++;
    },
    updateMyProp() {},
  },
};
</script>

<style></style>
